Provide common built-in error types so devs don't have to always define their own#14
Provide common built-in error types so devs don't have to always define their own#14
Conversation
|
I don't quite understand, what exactly |
|
@n0rthk1n9 Apple describes a type that conforms to the Sendable protocol as "A thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races." In other words, it means that the type is able to ensure values of the type can't be accessed from multiple places at the same time, which can lead to data races. Because errors are often thrown in other threads than the main thread, it's good to require Sendable conformance so we can create a UI that can read the error. And because errors are always read-only types like enums or structs, they all conform to It's more a "making it future-proof" topic right now since Swift concurrency checking in Swift 6 is not very strict yet, but as Apple iterates on it, it will become more and more important and more developers will know what it is. Thank you for approving, merging then! 🎉 |
Fixes #20.
Apart from introducing new error types, I've also decided to make
ThrowablerequireSendableconformance so errors can be thrown and passed around in concurrent code. Compared to the state I've shown you in our call, I have vastly improved the docs and also adjusted the error messages to be more useful.